package top.xmj.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.xmj.domain.FriendBO;
import top.xmj.pojo.Friend;
import top.xmj.pojo.User;

import java.util.*;

/**
 * @author 冰咖啡
 * Date:2022/12/13 13:49
 * Description:
 */
@Mapper
public interface FriendMapper extends BaseMapper<Friend> {

    /**
     * 根据用户id查找好友
     * @param userId
     * @return
     */
    public List<FriendBO> getListByUserId(@Param(value = "user_id")String userId);


    /**
     * 删除好友
     * @param userId
     * @param friendId
     * @return
     */
    public int deleteFriend(@Param("userId")String userId,@Param("friendId")String friendId);

    /**
     * 同意对方的添加
     * @param userId
     * @param friendId
     * @return
     */
    public int agreeAddFriend(@Param("userId")String userId,@Param("friendId")String friendId);

    /**
     *
     * @param userId
     * @param friendId
     * @return
     */
    public int rejectAddFriend(@Param("userId")String userId,@Param("friendId")String friendId);


    /**
     * 根据用户名查找好友
     * @param username
     * @return
     */
    public FriendBO findFriendByUserName(@Param("username") String username);

    /**
     * 判断对方是否是好友
     * @param userId
     * @param friendId
     * @return
     */
    public int isFriend(@Param("userId")String userId, @Param("friendId")String friendId);
}
